//
//  TWFXStruct_AllWeatherInfo.m
//  TWFXWeather
//
//  Created by Lion User on 13-10-6.
//  Copyright (c) 2013年 Lion User. All rights reserved.
//

#import "TWFXStruct_AllWeatherInfo.h"

@implementation TWFXStruct_AllWeatherInfo

-(id)init
{
    if (self = [super init]) {
        
        self.AQIInfo = [[[TWFXStruct_AQIInfo alloc] init] autorelease];
        self.realTimeWeatherInfo = [[[TWFXStruct_RealTimeWeatherInfo alloc] init] autorelease];
        self.futureWeatherInfo = [[[TWFXStruct_FutureWeatherInfo alloc] init] autorelease];
    }
    
    return self;
}

-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.proName forKey:@"proName"];
    [aCoder encodeObject:self.cityName forKey:@"cityName"];
    [aCoder encodeObject:self.cityPY forKey:@"cityPY"];
    [aCoder encodeObject:self.countID forKey:@"countID"];
    [aCoder encodeObject:self.countName forKey:@"countName"];
    [aCoder encodeObject:self.countPY forKey:@"countPY"];
    
    [aCoder encodeObject:self.AQIInfo forKey:@"AQIInfo"];
    [aCoder encodeObject:self.realTimeWeatherInfo forKey:@"realTimeWeatherInfo"];
    [aCoder encodeObject:self.futureWeatherInfo forKey:@"futureWeatherInfo"];
}

-(id)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super init]) {
        
        self.proName = [aDecoder decodeObjectForKey:@"proName"];
        self.cityName = [aDecoder decodeObjectForKey:@"cityName"];
        self.cityPY = [aDecoder decodeObjectForKey:@"cityPY"];
        self.countID = [aDecoder decodeObjectForKey:@"countID"];
        self.countName = [aDecoder decodeObjectForKey:@"countName"];
        self.countPY = [aDecoder decodeObjectForKey:@"countPY"];
        
        self.AQIInfo = [aDecoder decodeObjectForKey:@"AQIInfo"];
        self.futureWeatherInfo = [aDecoder decodeObjectForKey:@"futureWeatherInfo"];
        self.realTimeWeatherInfo = [aDecoder decodeObjectForKey:@"realTimeWeatherInfo"];
    }
    
    return self;
}

-(void)dealloc
{
    [_proName release];
    [_cityName release];
    [_cityPY release];
    [_countID release];
    [_countName release];
    [_countPY release];
    
    [_AQIInfo release];
    [_futureWeatherInfo release];
    [_realTimeWeatherInfo release];
    
    [super dealloc];
}

@end
